package com.jsjosem.aftersales.api;

import com.jsjosem.aftersales.data.request.ProductRequest;
import com.jsjosem.aftersales.data.response.BaseResponse;
import com.jsjosem.aftersales.data.response.PageResponse;
import com.jsjosem.aftersales.data.response.ProductResponse;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ProductApi {


    /*
     * 获取产品数据
     * */
    @GET("/products")
    Call<PageResponse<ProductResponse>> products(@Query("page") int page, @Query("per_page") int per_page);

    /*
     * 获取某个客户的所有设备
     * */
    @GET("/customers/{id}/products")
    Call<PageResponse<ProductResponse>> getCustomerProducts(@Path("id") int id);

    @POST("/products")
    Call<BaseResponse<Void>> createProduct(@Body ProductRequest productRequest);
}
